<%-- 
    Document   : index2
    Created on : 2017-3-20, 14:53:13
    Author     : DELL
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>教务管理系统登录页面</title>
        
        
            <script type="text/javascript">  
function checkusrn() {  
    var check = false;  
   
    var sno = document.getElementById("sno").value;  
     
    
    
    if (sno.length<6) {  
        document.getElementById("checktext1").innerHTML = "  × 不要少于6位";  
        
        check = false;  
    } else{  
        document.getElementById("checktext1").innerHTML = "  √";  
        
    
    return check; 
    }
} 
</script> 




            <script type="text/javascript"> 
function checkusrn1() {  
    var check = false;  
   
    
     var password = document.getElementById("password").value; 
    
     if(password.length<4){  
       
        
        document.getElementById("checktext2").innerHTML = "  × 不要少于4位";  
        
        check = false;  
       
    
    }  
    
    else{
         
         document.getElementById("checktext2").innerHTML = "  √";  
        
        
        
        check = true;  
    }
    return check;  
} 
</script> 



<script type="text/javascript">    
    function refresh() {    
        //IE存在缓存,需要new Date()实现更换路径的作用    
        document.getElementById("image").src="CreateImageAction.action?+ Math.random()"+new Date();    
    }    
</script> 
        
        
        
    </head>
    <body  bgcolor="#99aaee">
        <s:form action="login2" method="post" onsubmit="checkusrn()" >
            <h1 align="center">教务管理系统</h1>
            <br><br>
            <table width="40%" border="2" cellpadding="0" align="center" cellspacing="0"  bgcolor="#ffffff"  >
                <tr align="center">
                    <td  height="30" align="center">
                        <input type="radio" name="radiobutton" value="1"checked="checked">学生

                        <input type="radio" name="radiobutton" value="2">教师

                        <input type="radio" name="radiobutton" value="3">管理员

                    </td>
                </tr>

                <tr align="center">
                    <td   height="30" align="center">
                      
                        用户账号:<input type="text" name="sno" id="sno" size="20" onchange="checkusrn()" />
                        <span id="checktext1" ></span>
                    </td>
                </tr>
                <tr align="center">
                    <td  height="30" align="center">
                        用户密码:<input type="password" name="password" id="password" size="20" onchange="checkusrn1()" />
                        <span id="checktext2" ></span>
                    </td>
                </tr>

                <tr align="center">
                    <td>
                     验证码:<input type="text" name="checkCode" maxlength="4"   size="6" />
                        <img id="image" border="0"  onclick="refresh()"  src="CreateImageAction.action" title="看不清，换一张"  >
                    </td>

                </tr>

                                <tr align="center">
                    <td   height="30" align="center">
                        <input type="submit" value="确定">&nbsp;&nbsp;
                        <input type="reset" value="重置"/>
                    </td>
                </tr>
                
                
            </table>
            
                        
            
        </s:form>
    </body>
</html>
